package com.example.mahjong.ui.activity;

import android.app.Activity;

import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.example.mahjong.R;

public class MainPageActivity extends Activity{
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.mainpage);
        
        Button startGame = (Button)findViewById(R.id.start_game);
        startGame.setTextColor(Color.WHITE);
        startGame.setTextSize(28);
        Button endGame = (Button)findViewById(R.id.end_game);
        endGame.setTextColor(Color.WHITE);
        endGame.setTextSize(28);
        
        
    }

    @Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
	}
    
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
        Button startGame = (Button)findViewById(R.id.start_game);
        startGame.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent  = new Intent(MainPageActivity.this,GameActivity.class);
				//intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
				startActivity(intent);		
			}	
		});
        Button endGame = (Button)findViewById(R.id.end_game);
        endGame.setOnClickListener(new OnClickListener() {
 			public void onClick(View v) {
 				// TODO Auto-generated method stub
 				finish();
 			}	
 		});
	}

	

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	}
    
    
    
    
}
